import { defineComponent, KeepAlive } from "vue";
import { useStore as useTagsStore } from "@/store/tags";

export default defineComponent({
  setup() {
    const tagsStore = useTagsStore();
    return () => (
      <router-view>
        {
          ({ Component, route }: { Component: any, route: any }) => {
            return (
              <KeepAlive include={tagsStore.cachedViews}>
                {Component && <Component key={route.name} />}
              </KeepAlive>
            )
          }
        }
      </router-view>
    )
  }
})